package com.example.dragandview.seniorUI;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RatingBar;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.example.dragandview.R;

public class RatingBarActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.senionui_ratingbar);
        TextView textView = findViewById(R.id.textview_titlebar);
        textView.setText("星级评分条");
        final RatingBar ratingBar = findViewById(R.id.ratingbar);
        System.out.println(ratingBar.getRating());
        System.out.println(ratingBar.getStepSize());
        System.out.println(ratingBar.getProgress());
        Button btn = findViewById(R.id.btn_ratingbar);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println(ratingBar.getProgress());
                System.out.println(ratingBar.getRating());
            }
        });
    }
}
